package com.petRescueCenter.demo.pet.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.petRescueCenter.demo.common.enumPackage.PetTypeEmun;
import com.petRescueCenter.demo.user.entity.User;

@Entity
@Table(name = "t_pet")
public class Pet {
	private Long id;
	private String name;
	private String img;
	private PetTypeEmun type;
	private String feature;
	private User owner;
	private Date adoptTime;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public String getImg() {
		return img;
	}

	public String getFeature() {
		return feature;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
	public Date getAdoptTime() {
		return adoptTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
	public void setAdoptTime(Date adoptTime) {
		this.adoptTime = adoptTime;
	}

	@ManyToOne
	@JoinColumn(name = "ownerId")
	public User getOwner() {
		return owner;
	}

	public PetTypeEmun getType() {
		return type;
	}

	public void setType(PetTypeEmun type) {
		this.type = type;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public void setFeature(String feature) {
		this.feature = feature;
	}

}
